/*
 * @Description: 获取租户详情
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2022-01-06 13:48:25
 * @LastEditTime: 2022-01-06 13:58:42
 */
import { computed, ref, watch } from 'vue'
import { useStore } from 'vuex'

export function useTenantDetails() {
	const store = useStore()
	const tenantDetail = computed(() => store.state.tenant)

	return {
		tenantDetail,
	}
}

export function useUserInfo() {
	const store = useStore()
	const userInfo = ref()

	watch(
		store.state,
		state => {
			userInfo.value = state.userInfo || {}
		},
		{
			immediate: true,
			deep: true,
		}
	)

	return {
		userInfo,
	}
}
